/**
 * 
 */
package com.viettel.core.entities.cms;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import com.viettel.core.enumtype.SmsStatus;

/**
 *  Luu SMS do he thong gui
 *  @author: ToanTM1
 *  @version: 2.1
 *  @since: 2.1
 */
@Entity
@Table(name = "SMS_SEND_LOG")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SequenceGenerator(name = "SEQ_STORE", sequenceName = "SMS_SEND_LOG_SEQ", allocationSize = 1)
public class SmsSendLog implements Serializable {

	private static final long serialVersionUID = -6262407454563303560L;

	/**
	 * ID
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_STORE")
	@Column(name = "ID")
//	@Index(name="SMS_SEND_LOG_ID_PK")
	private Integer id;

	/**
	 * NOI DUNG SMS
	 */
	@Basic
	@Column(name = "CONTENT", nullable = false, length = 2048)
	private String content;

	/**
	 * NOI DUNG LOI
	 */
	@Basic
	@Column(name = "ERROR_CONTENT")
	private String errorContent;
	
	/**
	 * SO DIEN THOAI
	 */
	@Basic
	@Column(name = "PHONE", nullable = false, length = 50)
	private String phone;

	/**
	 * THOI GIAN GUI
	 */
	@Basic
	@Column(name = "SENT_TIME", columnDefinition = "timestamp(9) default systimestamp")
	@Temporal(TemporalType.TIMESTAMP)
	private Date sentTime;

	/**
	 * SO TIEN THANH TOAN
	 */
	@Basic
	@Column(name = "CHARGING", length = 50)
	private String charging;
	
	/**
	 * ID SV
	 */
	@Basic
	@Column(name = "SERVICE_ID")
	private String serviceId;

	/**
	 * APP NAME
	 */
	@Basic
	@Column(name = "APP_NAME",  length = 255)
	private String appName;

	/**
	 * TRANG THAI
	 */
	@Basic
	@Column(name = "STATUS", columnDefinition = "integer", nullable = false)
	@Type(type = "com.viettel.core.enumtype.GenericEnumUserType", parameters = {
			@Parameter(name = "enumClass", value = "com.viettel.core.enumtype.SmsStatus"),
			@Parameter(name = "identifierMethod", value = "getValue"),
			@Parameter(name = "valueOfMethod", value = "parseValue") })
	@Index(name="SMS_SEND_LOG_STATUSX")
	private SmsStatus status = SmsStatus.WAIT;
	
	/**
	 * THOI GIAN TAO
	 */
	@Basic
	@Column(name = "CREATED_TIME", columnDefinition = "timestamp(9) default systimestamp", insertable = false, updatable = false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createdTime;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getErrorContent() {
		return errorContent;
	}

	public void setErrorContent(String errorContent) {
		this.errorContent = errorContent;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Date getSentTime() {
		return sentTime;
	}

	public void setSentTime(Date sentTime) {
		this.sentTime = sentTime;
	}

	public String getServiceId() {
		return serviceId;
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public SmsStatus getStatus() {
		return status;
	}

	public void setStatus(SmsStatus status) {
		this.status = status;
	}

	public String getCharging() {
		return charging;
	}

	public void setCharging(String charging) {
		this.charging = charging;
	}

	/**
	 * @return the createdTime
	 */
	public Date getCreatedTime() {
		return createdTime;
	}

	/**
	 * @param createdTime the createdTime to set
	 */
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

}
